import { Body, Controller, Post } from '@nestjs/common';
import { MeetingRoomService } from './meeting-room.service';
import { RequireLogin } from 'src/custom.decorator';
import { ListMeetingDto } from './dto/list-meeting.dto';
import { CreateMeetingDto } from './dto/create-meeting.dto';
import { UpdateMeetingDto } from './dto/update-meeting.dto';

@Controller('/meeting-room')
// @RequireLogin()
export class MeetingRoomController {
  constructor(private readonly meetingRoomService: MeetingRoomService) {}
  @Post('init-data')
  initData() {
    this.meetingRoomService.initData();
  }
  @Post('list')
  async list(@Body() listMeetDto: ListMeetingDto) {
    return await this.meetingRoomService.list(listMeetDto);
  }
  @Post('create')
  async create(@Body() createMeetingDto: CreateMeetingDto) {
    return await this.meetingRoomService.create(createMeetingDto);
  }
  @Post('update')
  async update(@Body() updateMeetingDto: UpdateMeetingDto) {
    return await this.meetingRoomService.update(updateMeetingDto);
  }
  @Post('deleteById')
  async deleteById(@Body() data: { id: number }) {
    return await this.meetingRoomService.deleteById(data);
  }
}
